package cn.zy.sys.domain;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import cn.zy.basic.domain.BaseDomain;
import com.fasterxml.jackson.annotation.JsonInclude;

/**
 * 实体类：
 */
public class Menu extends BaseDomain{

    private String name;
    private String component;
    private String url;
    private String icon;
    private Integer index;
    private Long parentId;
    private String intro;
    private Boolean state;

    /**
     * 保存父级菜单信息
     *      前端做回显
     */
    private Menu parent;

    //保存菜单树的数据信息 - 需要给一个默认值 - 不然会出现null point exception
    //注解：无限极树最后一级不显示
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private List<Menu> children = new ArrayList<>();

    public List<Menu> getChildren() {
        return children;
    }

    public void setChildren(List<Menu> children) {
        this.children = children;
    }

    public Menu getParent() {
        return parent;
    }

    public void setParent(Menu parent) {
        this.parent = parent;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getComponent() {
        return component;
    }

    public void setComponent(String component) {
        this.component = component;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }

    public Integer getIndex() {
        return index;
    }

    public void setIndex(Integer index) {
        this.index = index;
    }

    public Long getParentId() {
        return parentId;
    }

    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }

    public String getIntro() {
        return intro;
    }

    public void setIntro(String intro) {
        this.intro = intro;
    }

    public Boolean getState() {
        return state;
    }

    public void setState(Boolean state) {
        this.state = state;
    }

    @Override
    public String toString() {
        return "Menu{" +
                "name='" + name + '\'' +
                ", component='" + component + '\'' +
                ", url='" + url + '\'' +
                ", icon='" + icon + '\'' +
                ", index=" + index +
                ", parentId=" + parentId +
                ", intro='" + intro + '\'' +
                ", state=" + state +
                ", parent=" + parent +
                ", children=" + children +
                '}';
    }
}